/*
 * @Author: pengtianrui 2276608413@qq.com
 * @Date: 2024-08-22 17:52:08
 * @LastEditors: Wang Shuo wangshuo@sgsimulation.com
 * @LastEditTime: 2024-08-30 13:43:08
 * @FilePath: \SGFEM\DataStructure\FEM\Property\src\PBUSHData.cpp
 */

#include "DataStructure/Input/Property/PBUSHData.h"

#include <cstddef>

#include "DataStructure/Common/Validation.h"

bool SG::DataStructure::FEM::operator== (const PBUSHData& a, const PBUSHData& b)
{
    if (a.m_id != b.m_id)
    {
        return false;
    }

    for (size_t i = 0; i < 6; i++)
    {
        if (!SG::DataStructure::Common::isNear (a.m_K[i], b.m_K[i]))
        {
            return false;
        }
        if (!SG::DataStructure::Common::isNear (a.m_B[i], b.m_B[i]))
        {
            return false;
        }
        if (!SG::DataStructure::Common::isNear (a.m_GE[i], b.m_GE[i]))
        {
            return false;
        }
    }

    if (!SG::DataStructure::Common::isNear (a.m_SA, b.m_SA))
    {
        return false;
    }
    if (!SG::DataStructure::Common::isNear (a.m_ST, b.m_ST))
    {
        return false;
    }
    if (!SG::DataStructure::Common::isNear (a.m_EA, b.m_EA))
    {
        return false;
    }
    if (!SG::DataStructure::Common::isNear (a.m_ET, b.m_ET))
    {
        return false;
    }
    if (!SG::DataStructure::Common::isNear (a.m_M, b.m_M))
    {
        return false;
    }
    if (!SG::DataStructure::Common::isNear (a.m_alpha, b.m_alpha))
    {
        return false;
    }
    if (!SG::DataStructure::Common::isNear (a.m_tref, b.m_tref))
    {
        return false;
    }
    if (!SG::DataStructure::Common::isNear (a.m_coinl, b.m_coinl))
    {
        return false;
    }
    if (a.m_domainId != b.m_domainId)
    {
        return false;
    }
    return true;
}